GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureDocumentConverter Class / CombineToPDF Method / CombineToPDF(IEnumerable<String>,String,PdfConformance) Method
An array of strings defining the file paths of all the documents you want to combine.
The file path where the destination file will be saved. If the specified file already exists, it will be overwritten.
A member of the PdfConformance enumeration. Specifies the required PDF version or conformance to the PDF or PDF/A standard of the resulting PDF document.
Example





In This Topic
CombineToPDF(IEnumerable<String>,String,PdfConformance) Method
In This Topic
This method combines all the specified input files to a single PDF document and saves the resulting file according to a file path you have specified.

The PDF version or the PDF conformance level of the resulting PDF document is set according to the given Conformance parameter.

Syntax
'Declaration
 
Public Overloads Function CombineToPDF( _
   ByVal InputFiles As IEnumerable(Of String), _
   ByVal DestFile As String, _
   Optional ByVal Conformance As PdfConformance _
) As GdPictureStatus
public GdPictureStatus CombineToPDF( 
   IEnumerable<string> InputFiles,
   string DestFile,
   PdfConformance Conformance
)
public function CombineToPDF( 
    InputFiles: IEnumerable;
    DestFile: String;
    Conformance: PdfConformance
): GdPictureStatus; 
public function CombineToPDF( 
   InputFiles : IEnumerable,
   DestFile : String,
   Conformance : PdfConformance
) : GdPictureStatus;
public: GdPictureStatus CombineToPDF( 
   IEnumerable<string*>* InputFiles,
   string* DestFile,
   PdfConformance Conformance
) 
public:
GdPictureStatus CombineToPDF( 
   IEnumerable<String^>^ InputFiles,
   String^ DestFile,
   PdfConformance Conformance
) 

Parameters

InputFiles
An array of strings defining the file paths of all the documents you want to combine.
DestFile
The file path where the destination file will be saved. If the specified file already exists, it will be overwritten.
Conformance
A member of the PdfConformance enumeration. Specifies the required PDF version or conformance to the PDF or PDF/A standard of the resulting PDF document.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Example
Combining multiple files of different formats to a single PDF document.
Dim inputFiles As IEnumerable(Of String) = New List(Of String)(New String() {"d:\image.jpg", "d:\document.pdf", "d:\image.tif", "d:\todo_list.xlsx"})
Using gdpictureDocumentConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter()
      gdpictureDocumentConverter.CombineToPDF(inputFiles, "d:\merged.pdf", PdfConformance.PDF1_5)
End Using
IEnumerable<string> inputFiles = new List<string>(new string[] { "d:\\image.jpg", "d:\\document.pdf", "d:\\image.tif", "d:\\todo_list.xlsx" });
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
   gdpictureDocumentConverter.CombineToPDF(inputFiles, "d:\\merged.pdf", PdfConformance.PDF1_5);
}
See Also